!Define HOW_TO_TURN_ON_TOOLBAR "Right-click in your taskbar and select$\n$\n Toolbar > Add Quick Search...$\n$\nto add the Quick Search Deskbar to your taskbar."
!Define TITLE_AND_COPYRIGHT "Dave's Quick Search Deskbar$\nCopyright (c) 2002 David Bau$\nDistributed under the terms of the$\nGNU General Public License, Version 2"
; Silent install
DirShow hide
CRCCheck on
SetDatablockOptimize on
Icon search.ico
SilentInstall silent
;ShowInstDetails show
; The file to write
OutFile "..\dqsd.exe"
; The default installation directory
InstallDir "$PROGRAMFILES\Quick Search Deskbar"
; Registry key to check for directory (so if you install again, it will
; The text to prompt the user to enter a directory
DirText "Choose a directory to install in to:"
; The stuff to install
Section "Quick Search Deskbar (required)"
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Confirm that the user really does want to install
MessageBox MB_YESNO|MB_ICONINFORMATION|MB_DEFBUTTON2 "This will install Dave's Quick Search Deskbar. Would you like to continue?" IDYES userconfirmedinstall
Abort
userconfirmedinstall:
; Verify that they've got the correct version of IE installed.
MessageBox MB_YESNO|MB_ICONEXCLAMATION|MB_DEFBUTTON2 "This version of Dave's Quick Search Deskbar requires IE version ${IE_MAJOR_REQUIRED}.${IE_MINOR_REQUIRED} or higher. You are currently running version $2.$3.$\n$\nWould you like to continue with the installation anyway?" IDYES ieVersionOK
Abort
ieVersionOK:
; Old versions to delete
; UnRegDLL $INSTDIR\DQSDTools.dll
; Delete /REBOOTOK $INSTDIR\DQSDTools.dll
UnRegDLL $INSTDIR\dqsdt253.dll
Delete /REBOOTOK $INSTDIR\dqsdt253.dll
UnRegDLL $INSTDIR\dqsdt254.dll
Delete /REBOOTOK $INSTDIR\dqsdt254.dll
UnRegDLL $INSTDIR\dqsdt255.dll
Delete /REBOOTOK $INSTDIR\dqsdt255.dll
UnRegDLL $INSTDIR\dqsdt257.dll
Delete /REBOOTOK $INSTDIR\dqsdt257.dll
UnRegDLL $INSTDIR\dqsdt258.dll
Delete /REBOOTOK $INSTDIR\dqsdt258.dll
; install new DLL
SetOverwrite try
ClearErrors
File "..\DQSDTools.dll"
IfErrors seeifsame register
; If was unable to upgrade, see if files are the same anyway
seeifsame:
ClearErrors
GetDLLVersionLocal "..\DQSDTools.dll" $1 $2
GetDLLVersion $INSTDIR\DQSDTools.dll $3 $4
IfErrors isdifferent
IntCmpU $1 $3 test1 isdifferent isdifferent
test1:
IntCmpU $2 $4 test2 isdifferent isdifferent
test2:
ClearErrors
GetFileTimeLocal "..\DQSDTools.dll" $1 $2
GetFileTime $INSTDIR\DQSDTools.dll $3 $4
IfErrors isdifferent
IntCmpU $1 $3 test3 isdifferent isdifferent
test3:
IntCmpU $2 $4 register isdifferent isdifferent
SetOverwrite on
; If different, install as another name and rename to correct file on reboot
StrCpy $8 "The Deskbar has been upgraded. $\nIf the search bar is already present $\non your taskbar, right-click on $\nthe handle to the left of the search bar $\nand select 'Refresh' to reload it. $\nIf the search bar is not present, $\n${HOW_TO_TURN_ON_TOOLBAR}$\n$\n${TITLE_AND_COPYRIGHT}"
IfFileExists "$INSTDIR\search.htm" upgradebar
StrCpy $8 "The Deskbar has been installed.$\n$\n${HOW_TO_TURN_ON_TOOLBAR}$\n$\n${TITLE_AND_COPYRIGHT}"
upgradebar:
WriteUninstaller "$INSTDIR\uninstall.exe"
; Put files there
File "..\ChangeLog.txt"
File "..\aliases.txt"
File "..\calculate.js"
File "..\calendar.js"
File "..\categoryExpander.htc"
File "..\clock.js"
File "..\defer_tools.js"
File "..\helpbox.js"
File "..\helpmenu.js"
File "..\history.js"
File "..\holidays.ausnsw.xml"
File "..\holidays.fr.xml"
File "..\holidays.ca.xml"
File "..\holidays.it.xml"
File "..\holidays.nl.NL.xml"
File "..\holidays.nl.EN.xml"
File "..\holidays.sg.xml"
File "..\holidays.us.xml"
File "..\loader.js"
File "..\maximized.htm"
File "..\preferences.js"
File "..\readme.txt"
File "..\savesearchsettings.js"
File "..\search.css"
File "..\search.htm"
File "..\strings.js"
File "..\tools.js"
File "..\translate.js"
File "..\version.js"
File "..\version.xml"
File "..\versiondialog.htm"
File "..\xplocalsearch.css"
File "..\xptoolbarbot.bmp"
File "..\xptoolbartop.bmp"
SetOutPath "$INSTDIR\searches"
File "..\searches\*.xml"
SetOutPath "$INSTDIR\src"
File "search.ico"
File "search.nsi"
File "build.cmd"
File "clean.cmd"
File "scrub.cmd"
File "dqsd.xml"
SetOutPath "$INSTDIR\src\DQSDTools"
File "DQSDTools\DQSDTools.cpp"
File "DQSDTools\DQSDTools.def"
File "DQSDTools\DQSDTools.dep"
File "DQSDTools\DQSDTools.dsp"
File "DQSDTools\DQSDTools.dsw"
File "DQSDTools\DQSDTools.idl"
File "DQSDTools\DQSDTools.mak"
File "DQSDTools\DQSDTools.rc"
File "DQSDTools\Launcher.cpp"
File "DQSDTools\Launcher.h"
File "DQSDTools\Launcher.rgs"
File "DQSDTools\MenuBuilder.rgs"
File "DQSDTools\MenuBuilder.h"
File "DQSDTools\MenuBuilder.cpp"
File "DQSDTools\KeyboardHook.h"
File "DQSDTools\KeyboardHook.cpp"
File "DQSDTools\License.txt"
File "DQSDTools\StdAfx.cpp"
File "DQSDTools\StdAfx.h"
File "DQSDTools\Utilities.h"
File "DQSDTools\Utilities.cpp"
File "DQSDTools\resource.h"
; Create files with user preferences if they doesn't exist
SetOverwrite off
SetOutPath "$INSTDIR"
File "..\localaliases.txt"
File "..\mrumenu.txt"
File "..\localsearch.css"
File "..\localprefs.js"
SetOverwrite on
; Create subdirectory for user searches
CreateDirectory "localsearches"
; old source files used to live here
Delete $INSTDIR\license.txt
Delete $INSTDIR\search.ico
Delete $INSTDIR\search.nsi
Delete $INSTDIR\dqsd.xml
Delete $INSTDIR\search.xml
; old versions of searches to delete; most renamed or consolidated
MessageBox MB_YESNO|MB_ICONINFORMATION|MB_DEFBUTTON1 "The Deskbar has been upgraded.$\nYou must reboot before it will work correctly.$\nAfter rebooting, if the search bar$\nis not visible, ${HOW_TO_TURN_ON_TOOLBAR}$\n$\nWould you like to reboot now (recommended)?" IDYES doreboot
; MessageBox MB_OK|MB_ICONINFORMATION "Please remember to reboot before using the search bar.$\n$\n${TITLE_AND_COPYRIGHT}"
Goto endinstall
norebootmsg:
MessageBox MB_OK|MB_ICONINFORMATION "$8"
Goto endinstall
doreboot:
Reboot
endinstall:
SectionEnd
; uninstall stuff
UninstallText "Click next to uninstall Dave's Quick Search Deskbar."